#set(CMAKE_BUILD_TYPE Debug)

include(CheckFunctionExists)
include(CheckTypeSize)

set(CMAKE_EXTRA_INCLUDE_FILES "sys/types.h")

CHECK_TYPE_SIZE("u_int32_t" HAVE_U_INT32_T)
CHECK_FUNCTION_EXISTS("select" HAVE_SELECT)

set(CMAKE_EXTRA_INCLUDE_FILES)

if (HAVE_SELECT)
	add_definitions(-DHAVE_SELECT=1)
endif (HAVE_SELECT)
if (HAVE_U_INT32_T)
	add_definitions(-DHAVE_SELECT=1 -DHAVE_U_INT32_T=1)
endif (HAVE_U_INT32_T)

add_definitions(-DUSE_CRC32_HASH=1)

add_library(memcache memcache.c buffer.c)
